Check if the completion is the same one as the old one.
authorAnders Carlsson <andersca@gnome.org>
Fri, 23 Jan 2004 08:38:47 +0000 (08:38 +0000)
committerAnders Carlsson <andersca@src.gnome.org>
Fri, 23 Jan 2004 08:38:47 +0000 (08:38 +0000)
2004-01-23  Anders Carlsson  <andersca@gnome.org>

* gtk/gtkentry.c: (gtk_entry_set_completion):
Check if the completion is the same one as the old one.

* gtk/gtkentrycompletion.c:
* gtk/gtkentrycompletion.h:
Move GET_PRIVATE macro into .c file, fix a trivial spelling
error.

gtk/gtkentry.c
gtk/gtkentrycompletion.c
gtk/gtkentrycompletion.h

index 931606d0479a793c726b1130a5addb79dbca4a85..394ca2a6a34281187c8c1a3a32c7b89aee15331c 100644 (file)
@@ -4716,6 +4716,9 @@ gtk_entry_set_completion (GtkEntry           *entry,
 
   old = gtk_entry_get_completion (entry);
 
+  if (old == completion)
+    return;
+  
   if (old)
     {
       if (old->priv->completion_timeout)
index cc615ccaa346c786754446f5a5dea8f43f593440..13884a8c7bb6e9c7c24f7543b1a44e4392d2e9ea 100644 (file)
@@ -52,6 +52,7 @@ enum
   PROP_MINIMUM_KEY_LENGTH
 };
 
+#define GTK_ENTRY_COMPLETION_GET_PRIVATE(obj)(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletionPrivate))
 
 static void     gtk_entry_completion_class_init          (GtkEntryCompletionClass *klass);
 static void     gtk_entry_completion_cell_layout_init    (GtkCellLayoutIface      *iface);
@@ -989,7 +990,7 @@ gtk_entry_completion_delete_action (GtkEntryCompletion *completion,
  * @completion: A #GtkEntryCompletion.
  * @column: The column in the model of @completion to get strings from.
  *
- * Conviencefunction for setting up the most used case of this code: a
+ * Convience function for setting up the most used case of this code: a
  * completion list with just strings. This function will set up @completion
  * to have a list displaying all (and just) strings in the completion list,
  * and to get those strings from @column in the model of @completion.
index beb59b0742c9fbdf7f4c7b93f3b79fe01bddeb58..aed8165070e3b77bad601c7edf59b5f375448ba8 100644 (file)
@@ -35,7 +35,6 @@ G_BEGIN_DECLS
 #define GTK_IS_ENTRY_COMPLETION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ENTRY_COMPLETION))
 #define GTK_IS_ENTRY_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ENTRY_COMPLETION))
 #define GTK_ENTRY_COMPLETION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletionClass))
-#define GTK_ENTRY_COMPLETION_GET_PRIVATE(obj)(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_ENTRY_COMPLETION, GtkEntryCompletionPrivate))
 
 typedef struct _GtkEntryCompletion            GtkEntryCompletion;
 typedef struct _GtkEntryCompletionClass       GtkEntryCompletionClass;